Random = Mock.Random

function pets(){
    let data = {
        pet_list:[],
        totalPage: 10,
        nowPage : 1,
    }



    for(let i = 0; i < 10; i++){
        data.pet_list.push(Mock.mock({
            "id": Random.integer(0,1000),
            "name": Random.cname(),
            "type":Random.cname(),
            "kind":Random.cname(),
            "intro":Random.cparagraph(30,50),
            "price": Random.float(100,1000,2,2),
            "image": Random.image(),
            "stock": Random.integer(0,1000)
        }))
    }

    return{
        data,
        code: 200,
        msg: '获取成功',

    }
}

function removePet(){
    return {
        'code':200,
        'msg': '删除成功'
    }
}

Mock.mock(/http:\/\/localhost\/pets.php.*?/, 'get' ,pets)

Mock.mock('http://localhost/del_pet.php', 'post' ,removePet)

